//
//  LTHomeworkAipManager.m
//  LearnTeacher
//
//  Created by zyl on 2024/4/23.
//

#import "LTHomeworkAipManager.h"

@implementation LTHomeworkAipManager

+ (void)getHomeworkListWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_URL,HOMEWORK_INDEX_URL];
    [BaseRequest baseGET:url cache:NO autoHideLoading:NO parms:param request:^(id resultObject, NSError *error) {
        resultBlock(resultObject);
    }];
}
+ (void)getGradeListWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_URL,HOMEWORK_GRADE_INDEX_URL];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
        if (resultObject&&[resultObject[@"code"] doubleValue] == 1) {
             resultBlock(resultObject);
         }else{
             NSDictionary *dic = (NSDictionary *)resultObject;
             [SVProgressHUD showImage:nil status:dic[@"msg"]];
         }
    }];
   
}

+ (void)getTextBookWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_URL,HOMEWORK_TEXT_BOOK];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
        if (resultObject&&[resultObject[@"code"] doubleValue] == 1) {
             resultBlock(resultObject);
         }else{
             NSDictionary *dic = (NSDictionary *)resultObject;
             [SVProgressHUD showImage:nil status:dic[@"msg"]];
         }
    }];
   
}

+ (void)getTextBookUnitWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_URL,HOMEWORK_TEXT_BOOK_UNIT];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
        if (resultObject&&[resultObject[@"code"] doubleValue] == 1) {
             resultBlock(resultObject);
         }else{
             NSDictionary *dic = (NSDictionary *)resultObject;
             [SVProgressHUD showImage:nil status:dic[@"msg"]];
         }
    }];
   
}

+ (void)switchtextbookspWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_URL,HOMEWORK_TEXT_BOOK_SWITCHTEXTBOOKSP];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
        if (resultObject&&[resultObject[@"code"] doubleValue] == 1) {
             resultBlock(resultObject);
         }else{
             NSDictionary *dic = (NSDictionary *)resultObject;
             [SVProgressHUD showImage:nil status:dic[@"msg"]];
         }
    }];
   
}

+ (void)switchunitWithParam:(NSDictionary *)param result:(void(^)(NSDictionary *dic))resultBlock
{
    NSString *url = [NSString stringWithFormat:@"%@%@",BASE_URL,HOMEWORK_TEXT_BOOK_SWITCHTEXTBOOKUNIT];
    [BaseRequest basePOST:url cache:NO autoHideLoading:NO parms:param result:^(id resultObject, NSError *error) {
        if (resultObject&&[resultObject[@"code"] doubleValue] == 1) {
             resultBlock(resultObject);
         }else{
             NSDictionary *dic = (NSDictionary *)resultObject;
             [SVProgressHUD showImage:nil status:dic[@"msg"]];
         }
    }];
   
}

@end
